Billions of warning fixes for MSVC-like substances.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 18 Mar 2005 03:56:36 +0000 (03:56 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Fri, 18 Mar 2005 03:56:36 +0000 (03:56 +0000)
From Andrew Kirmse (akirmse at google's mail) and to a lesser degree, myself.

52 files changed:
gpsbabel/Makefile
gpsbabel/cetus.c
gpsbabel/coastexp.c
gpsbabel/coldsync/pdb.c
gpsbabel/coldsync/util.c
gpsbabel/copilot.c
gpsbabel/csv_util.c
gpsbabel/defs.h
gpsbabel/delgpl.c
gpsbabel/easygps.c
gpsbabel/garmin.c
gpsbabel/gcdb.c
gpsbabel/geoniche.c
gpsbabel/glogbook.c
gpsbabel/gpilots.c
gpsbabel/gpspilot.c
gpsbabel/gpx.c
gpsbabel/html.c
gpsbabel/igc.c
gpsbabel/jeeps/gps.h
gpsbabel/jeeps/gpsapp.c
gpsbabel/jeeps/gpscom.c
gpsbabel/jeeps/gpscom.h
gpsbabel/jeeps/gpsprot.h
gpsbabel/jeeps/gpsread.c
gpsbabel/jeeps/gpsread.h
gpsbabel/jeeps/gpssend.c
gpsbabel/jeeps/gpsserial.c
gpsbabel/jeeps/gpsserial.h
gpsbabel/jeeps/gpsusbread.c
gpsbabel/jeeps/gpsusbsend.c
gpsbabel/jeeps/gpsusbwin.c
gpsbabel/kml.c
gpsbabel/magnav.c
gpsbabel/magproto.c
gpsbabel/mapopolis.c
gpsbabel/mapsend.c
gpsbabel/mapsource.c
gpsbabel/msvc/GPSBabel.dsp
gpsbabel/msvc/GPSBabel.vcproj
gpsbabel/nmea.c
gpsbabel/palmdoc.c
gpsbabel/position.c
gpsbabel/psitrex.c
gpsbabel/quovadis.c
gpsbabel/shape.c
gpsbabel/stackfilter.c
gpsbabel/text.c
gpsbabel/tools/mkchanges
gpsbabel/util.c
gpsbabel/uuid.c
gpsbabel/vcf.c

index 6c8849f596c6cbd362496eac5151f36cbd485a6a..21e4b5111dc5d37ab17868baad7d5cc1c345bcd2 100644 (file)
@@ -158,7 +158,7 @@ gpilots.o: gpilots.c defs.h queue.h gbtypes.h coldsync/palm.h \
 gpspilot.o: gpspilot.c defs.h queue.h gbtypes.h coldsync/palm.h \
   coldsync/pdb.h
 gpsutil.o: gpsutil.c defs.h queue.h gbtypes.h magellan.h
-gpx.o: gpx.c defs.h queue.h gbtypes.h
+gpx.o: gpx.c defs.h queue.h gbtypes.h xmlgeneric.h
 grtcirc.o: grtcirc.c defs.h queue.h gbtypes.h
 hiketech.o: hiketech.c defs.h queue.h gbtypes.h xmlgeneric.h
 holux.o: holux.c defs.h queue.h gbtypes.h holux.h
@@ -170,6 +170,7 @@ html.o: html.c defs.h queue.h gbtypes.h jeeps/gpsmath.h jeeps/gps.h \
   jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h
 igc.o: igc.c defs.h queue.h gbtypes.h
 internal_styles.o: internal_styles.c defs.h queue.h gbtypes.h
+kml.o: kml.c defs.h queue.h gbtypes.h xmlgeneric.h
 lowranceusr.o: lowranceusr.c defs.h queue.h gbtypes.h
 magnav.o: magnav.c defs.h queue.h gbtypes.h coldsync/palm.h \
   coldsync/pdb.h
@@ -274,7 +275,7 @@ jeeps/gpsread.o: jeeps/gpsread.c jeeps/gps.h defs.h queue.h gbtypes.h \
   jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
   jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \
   jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \
-  jeeps/gpsnmeaget.h
+  jeeps/gpsnmeaget.h jeeps/gpsusbint.h
 jeeps/gpsrqst.o: jeeps/gpsrqst.c jeeps/gps.h defs.h queue.h gbtypes.h \
   jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \
   jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
@@ -286,25 +287,27 @@ jeeps/gpssend.o: jeeps/gpssend.c jeeps/gps.h defs.h queue.h gbtypes.h \
   jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
   jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \
   jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \
-  jeeps/gpsnmeaget.h
+  jeeps/gpsnmeaget.h jeeps/gpsusbint.h
 jeeps/gpsserial.o: jeeps/gpsserial.c jeeps/gps.h defs.h queue.h gbtypes.h \
   jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \
   jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h jeeps/gpscom.h \
   jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h jeeps/gpsmem.h \
   jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h jeeps/gpsnmeafmt.h \
-  jeeps/gpsnmeaget.h
+  jeeps/gpsnmeaget.h jeeps/garminusb.h
 jeeps/gpsusbread.o: jeeps/gpsusbread.c jeeps/gps.h defs.h queue.h \
   gbtypes.h jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h \
   jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \
   jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h \
   jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h \
-  jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h
+  jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h \
+  jeeps/gpsusbint.h
 jeeps/gpsusbsend.o: jeeps/gpsusbsend.c jeeps/gps.h defs.h queue.h \
   gbtypes.h jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h \
   jeeps/gpsread.h jeeps/gpsutil.h jeeps/gpsapp.h jeeps/gpsprot.h \
   jeeps/gpscom.h jeeps/gpsfmt.h jeeps/gpsmath.h jeeps/gpsnmea.h \
   jeeps/gpsmem.h jeeps/gpsrqst.h jeeps/gpsinput.h jeeps/gpsproj.h \
-  jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h
+  jeeps/gpsnmeafmt.h jeeps/gpsnmeaget.h jeeps/garminusb.h \
+  jeeps/gpsusbint.h
 jeeps/gpsusbstub.o: jeeps/gpsusbstub.c
 jeeps/gpsutil.o: jeeps/gpsutil.c jeeps/gps.h defs.h queue.h gbtypes.h \
   jeeps/gpsport.h jeeps/gpsserial.h jeeps/gpssend.h jeeps/gpsread.h \
@@ -316,3 +319,4 @@ shapelib/dbfopen.o: shapelib/dbfopen.c shapelib/shapefil.h
 shapelib/shpopen.o: shapelib/shpopen.c shapelib/shapefil.h
 internal_styles.c: mkstyle.sh style/README.style style/arc.style style/csv.style style/custom.style style/dna.style style/fugawi.style style/gpsdrive.style style/gpsman.style style/mapconverter.style style/mxf.style style/nima.style style/s_and_t.style style/saplus.style style/tabsep.style style/xmap.style style/xmapwpt.style
        ./mkstyle.sh > internal_styles.c || (rm -f internal_styles.c ; exit 1)
+       ./mkstyle.sh > internal_styles.c || (rm -f internal_styles.c ; exit 1)
index f46cc2b078b8b6e76206701ad61e2b94e2f3b2f7..2e462fff2a049a560487094e8d8374261a870b3d 100644 (file)
@@ -60,7 +60,7 @@ struct record {
        unsigned char sec;
        
        /* accuracy and precision information for use where applicable */
-       char  sat; /* ff if averaged or unknown */
+       unsigned char  sat; /* ff if averaged or unknown */
        pdb_16 pdop; /* pdop * 100 */
        pdb_16 hdop;
        pdb_16 vdop;
@@ -238,13 +238,13 @@ cetus_writewpt(const waypoint *wpt)
                be_write16(&rec->year, 0xff);
        }
 
-       be_write32(&rec->longitude, wpt->longitude * 10000000.0);
-       be_write32(&rec->latitude, wpt->latitude * 10000000.0);
+       be_write32(&rec->longitude, (unsigned int) (wpt->longitude * 10000000.0));
+       be_write32(&rec->latitude, (unsigned int) (wpt->latitude * 10000000.0));
        if ( wpt->altitude == unknown_alt ) {
-               be_write32(&rec->elevation, -100000000U);
+               be_write32(&rec->elevation, -100000000);
        }
        else {
-               be_write32(&rec->elevation, wpt->altitude * 100.0);
+               be_write32(&rec->elevation, (unsigned int) (wpt->altitude * 100.0));
        }
        
        be_write16( &rec->pdop, 0xffff );
@@ -327,7 +327,7 @@ cetus_writewpt(const waypoint *wpt)
        }
        vdata += strlen( vdata ) + 1;
        
-       opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec);
+       opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);
        
        if (opdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create record\n");
index e262285dfb279e8e53aebdaf5ce6fb2e28920693..9852089508317fb627f8071781584d172dacbdea 100755 (executable)
@@ -605,7 +605,6 @@ ce_write(void)
           the standalone waypoints.
        */
        time_t now = 0;
-       int short_length;
        now = current_time();
 
        write_xml_header(ofd);
index a19e3fe0259b0c2b428a01d9dc2c0bb09913ef2f..d3c5491286b4961c821ed8423fa9ee1365ad3f04 100644 (file)
@@ -6,7 +6,7 @@
  *     You may distribute this file under the terms of the Artistic
  *     License, as specified in the README file.
  *
- * $Id: pdb.c,v 1.6 2004-04-16 16:47:51 parkrrrr Exp $
+ * $Id: pdb.c,v 1.7 2005-03-18 03:56:35 robertl Exp $
  */
 /* XXX - The way zero-length records are handled is a bit of a kludge. They
  * shouldn't normally exist, with the exception of expunged records. But,
@@ -33,7 +33,9 @@
  * but doesn't have it prototyped.  Systems with 64-bit file I/O but
  * based on LP64 model (i.e. OS/X) _require_ the prototype for lseek.
  */
-#if !defined (__WIN32__)
+#if defined (__WIN32__)
+#include <io.h>
+#else
 #include <unistd.h>
 #endif
 #include <stdlib.h>
@@ -434,7 +436,7 @@ pdb_Write(const struct pdb *db,
        wptr = header_buf;
        memcpy(wptr, db->name, PDB_DBNAMELEN);
        wptr += PDB_DBNAMELEN;
-       put_uword(&wptr, (db->attributes & ~PDB_ATTR_OPEN));
+       put_uword(&wptr, (uword) (db->attributes & ~PDB_ATTR_OPEN));
                                /* Clear the 'open' flag before writing */
        put_uword(&wptr, db->version);
        put_udword(&wptr, db->ctime);
@@ -1200,7 +1202,7 @@ get_file_length(int fd)
        /* And return to where we were before */
        lseek(fd, here, SEEK_SET);
 
-       return eof - here;
+       return (uword) (eof - here);
 }
 
 /* pdb_LoadHeader
@@ -1519,9 +1521,9 @@ pdb_LoadAppBlock(int fd,
                 struct pdb *db)
 {
        int err;
-       localID next_off;               /* Offset of the next thing in the file
+       udword next_off;                /* Offset of the next thing in the file
                                 * after the AppInfo block */
-       off_t offset;           /* Offset into file, for checking */
+       udword offset;          /* Offset into file, for checking */
 
        /* Check to see if there even *is* an AppInfo block */
        if (db->appinfo_offset == 0L)
@@ -1582,7 +1584,7 @@ pdb_LoadAppBlock(int fd,
         * we've already passed the beginning of the AppInfo block, as
         * given by its offset in the header.
         */
-       offset = lseek(fd, 0L, SEEK_CUR);       /* Find out where we are */
+       offset = (udword) lseek(fd, 0L, SEEK_CUR);      /* Find out where we are */
        if (offset != db->appinfo_offset)
        {
                if (offset > db->appinfo_offset)
@@ -1638,7 +1640,7 @@ pdb_LoadSortBlock(int fd,
        int err;
        localID next_off;               /* Offset of the next thing in the file
                                 * after the sort block */
-       off_t offset;           /* Offset into file, for checking */
+       localID offset;         /* Offset into file, for checking */
 
        /* Check to see if there even *is* a sort block */
        if (db->sortinfo_offset == 0L)
@@ -1695,7 +1697,7 @@ pdb_LoadSortBlock(int fd,
         * we've already passed the beginning of the sort block, as given
         * by its offset in the header.
         */
-       offset = lseek(fd, 0L, SEEK_CUR);       /* Find out where we are */
+       offset = (udword) lseek(fd, 0L, SEEK_CUR);      /* Find out where we are */
        if (offset != db->sortinfo_offset)
        {
                if (offset > db->sortinfo_offset)
@@ -1755,7 +1757,7 @@ pdb_LoadResources(int fd,
             i < db->numrecs;
             i++, rsrc = rsrc->next)
        {
-               off_t offset;           /* Current offset, for checking */
+               udword offset;          /* Current offset, for checking */
                udword next_off;        /* Offset of next resource in file */
 
                /* Sanity check: make sure we haven't stepped off the end
@@ -1785,7 +1787,7 @@ pdb_LoadResources(int fd,
                 * whether we've already passed the beginning of the
                 * resource, as given by its offset in the resource index.
                 */
-               offset = lseek(fd, 0L, SEEK_CUR);
+               offset = (udword) lseek(fd, 0L, SEEK_CUR);
                                        /* Find out where we are now */
                if (offset != rsrc->offset)
                {
@@ -1843,7 +1845,7 @@ pdb_LoadResources(int fd,
                /* Subtract this resource's index from that of the next
                 * thing, to get the size of this resource.
                 */
-               rsrc->data_len = next_off - rsrc->offset;
+               rsrc->data_len = (uword) (next_off - rsrc->offset);
 
                /* Allocate space for this resource */
                if ((rsrc->data = (ubyte *) malloc(rsrc->data_len)) == NULL)
@@ -1893,7 +1895,7 @@ pdb_LoadRecords(int fd,
             i < db->numrecs;
             i++, rec = rec->next)
        {
-               off_t offset;           /* Current offset, for checking */
+               udword offset;          /* Current offset, for checking */
                localID next_off;       /* Offset of next resource in file */
 
                /* Sanity check: make sure we haven't stepped off the end
@@ -1918,7 +1920,7 @@ pdb_LoadRecords(int fd,
                 * whether we've already passed the beginning of the
                 * record, as given by its offset in the record index.
                 */
-               offset = lseek(fd, 0L, SEEK_CUR);
+               offset = (udword) lseek(fd, 0L, SEEK_CUR);
                                        /* Find out where we are now */
                if (offset != rec->offset)
                {
@@ -1975,7 +1977,7 @@ pdb_LoadRecords(int fd,
                /* Subtract this record's index from that of the next one,
                 * to get the size of this record.
                 */
-               rec->data_len = next_off - rec->offset;
+               rec->data_len = (uword) (next_off - rec->offset);
 
                /* Allocate space for this record
                 * If there's a record with length zero, don't pass that to
index 81b6ffd1d9c268b52a5e060da10b85c46331f0de..2d7031d3c7677f3a19ae7cea02a1acdb60a702e0 100644 (file)
@@ -12,7 +12,7 @@
  * native format, convert them to Palm (big-endian) format, and write
  * them to a ubyte string.
  *
- * $Id: util.c,v 1.3 2004-01-18 01:24:41 robertl Exp $
+ * $Id: util.c,v 1.4 2005-03-18 03:56:35 robertl Exp $
  */
 
 #include "config.h"
@@ -65,7 +65,7 @@ get_ubyte(const ubyte **buf)
 }
 
 INLINE void
-put_ubyte(ubyte **buf, ubyte value)
+put_ubyte(ubyte **buf, const ubyte value)
 {
        **buf = value;
        ++(*buf);
@@ -83,7 +83,7 @@ get_uword(const ubyte **buf)
 }
 
 INLINE void
-put_uword(ubyte **buf, uword value)
+put_uword(ubyte **buf, const uword value)
 {
        **buf = (value >> 8) & 0xff;
        ++(*buf);
@@ -103,15 +103,15 @@ get_udword(const ubyte **buf)
 }
 
 INLINE void
-put_udword(ubyte **buf, udword value)
+put_udword(ubyte **buf, const udword value)
 {
-       **buf = (value >> 24) & 0xff;
+       **buf = (ubyte) ((value >> 24) & 0xff);
        ++(*buf);
-       **buf = (value >> 16) & 0xff;
+       **buf = (ubyte) ((value >> 16) & 0xff);
        ++(*buf);
-       **buf = (value >>  8) & 0xff;
+       **buf = (ubyte) ((value >>  8) & 0xff);
        ++(*buf);
-       **buf = value & 0xff;
+       **buf = (ubyte) (value & 0xff);
        ++(*buf);
 }
 #if TIME
index abb9bb0fc662f98b1baaf693d4190d6c9ef868a5..d55adb62f6f0debd829eb856d9f4606d75cc1ebe 100644 (file)
@@ -158,7 +158,7 @@ copilot_writewpt(const waypoint *wpt)
        }
        vdata += strlen( vdata ) + 1;
 
-       opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec);             
+       opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);           
 
        if (opdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create record\n");
index 61d2d978fc197e5502634e62d5fd0109a00830d3..091bc9789ea78ac45454d06ef366d206abb0991b 100644 (file)
 extern char *xcsv_urlbase;
 extern char *prefer_shortnames;
 
+extern const char *gs_get_container(geocache_container t);
+extern geocache_container gs_mktype(const char *t);
+extern geocache_container gs_mkcont(const char *t);
+extern const char *gs_get_cachetype(geocache_type t);
+
 static double pathdist = 0;
 static double oldlon = 999;
 static double oldlat = 999;
@@ -649,7 +654,7 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp)
     } else
     if (strcmp(fmp->key, "LAT_INT32DEG") == 0) {
        /* latitude as a 32 bit integer offset */
-       wpt->latitude = intdeg_to_dec(atof(s), 1);
+       wpt->latitude = intdeg_to_dec((int) atof(s), 1);
     } else
     if ( strcmp(fmp->key, "LAT_HUMAN_READABLE") == 0) {
        human_to_dec( s, &wpt->latitude, &wpt->longitude, 1 );
@@ -669,7 +674,7 @@ xcsv_parse_val(const char *s, waypoint *wpt, const field_map_t *fmp)
     } else
     if (strcmp(fmp->key, "LON_INT32DEG") == 0) {
        /* longitude as a 32 bit integer offset  */
-       wpt->longitude = intdeg_to_dec(atof(s), 0);
+       wpt->longitude = intdeg_to_dec((int) atof(s), 0);
     } else
     if ( strcmp(fmp->key, "LON_HUMAN_READABLE") == 0) {
        human_to_dec( s, &wpt->latitude, &wpt->longitude, 2 );
@@ -812,7 +817,7 @@ xcsv_data_read(void)
 }
 
 static void
-xcsv_resetpathlen()
+xcsv_resetpathlen(const route_head *head)
 {
     pathdist = 0;
     oldlat = 999;
index 7afd45e802118dde5e496f748ac02f8e25e55fc1..93eaa0c19482b9f91479943dc56e6781c44650cb 100644 (file)
 #  define snprintf _snprintf
 #endif
 
+/* Turn off numeric conversion warning */
+#if __WIN32__
+#pragma warning(disable:4244)
+#endif
+
 /*
  * Common definitions.   There should be no protocol or file-specific
  * data in this file.
@@ -424,6 +429,7 @@ typedef struct filter_vecs {
 void waypt_init(void);
 void route_init(void);
 void waypt_disp(const waypoint *);
+void waypt_status_disp(int total_ct, int myct);
 void fatal(const char *, ...)
 #if __GNUC__
        __attribute__ ((__format__ (__printf__, 1, 2)))
@@ -434,13 +440,13 @@ void warning(const char *, ...)
        __attribute__ ((__format__ (__printf__, 1, 2)))
 #endif
        ;
-ff_vecs_t *find_vec(char *, char **);
+ff_vecs_t *find_vec(char * const, char **);
 void disp_vecs(void);
 void exit_vecs(void);
 void disp_formats(int version);
-void printposn(double c, int is_lat);
+void printposn(const double c, int is_lat);
 
-filter_vecs_t * find_filter_vec(char *, char **);
+filter_vecs_t * find_filter_vec(char * const, char **);
 void free_filter_vec(filter_vecs_t *);
 void disp_filters(int version);
 void disp_filter_vecs(void);
index 22c34b0fddae0c82396b56ee7f7a09d9abb36715..3e65936bfe37a4399a22b3e315446b6d644e5673 100644 (file)
@@ -56,7 +56,6 @@ gpl_read(void)
 {
        waypoint *wpt_tmp;
        route_head *track_head;
-       int br;
        gpl_point_t gp;
        double alt_feet;
 
index b64373b1efbd42700910b04ebb6a25ebf51835c5..bcfab3f03893bf150d4a61b042f1afe116f0a3e1 100644 (file)
@@ -25,7 +25,7 @@
 static FILE *file_in;
 static FILE *file_out;
 static void *mkshort_handle;
-static char *deficon = NULL;
+/* static char *deficon = NULL; */
 
 #define MYNAME "EasyGPS"
 
index 9c433408700fe10939e49718ccb1424d58b07b6b..259709a718370ea6e5c3cbd1093ee010e52d1fb0 100644 (file)
@@ -168,6 +168,7 @@ waypt_read_cb(int total_ct, GPS_PWay *way)
                i++;
                waypt_status_disp(total_ct, i);
        }
+       return 0;
 }
 
 static void
@@ -389,7 +390,7 @@ sane_GPS_Way_New(void)
        way->addr[0] = 0;
        way->cross_road[0] = 0;
        way->cross_road[0] = 0;
-       way->dpth = 1.0e25;
+       way->dpth = 1.0e25f;
        way->wpt_class = 0;
 
        return way;
@@ -433,7 +434,6 @@ waypoint_write(void)
        queue *elem, *tmp;
        extern queue waypt_head;
        GPS_PWay *way;
-       extern int32 gps_save_id;
        int icon;
 
        way = xcalloc(n,sizeof(*way));
@@ -639,7 +639,7 @@ track_write(void)
 }
 
 static void
-data_write()
+data_write(void)
 {
        if (poweroff) {
                return;
index a67230628da8f06ddf3210d62ce298abc4cacd92..8f9727736ad8bdaa2fee3724de5ca0516d05ecec 100644 (file)
@@ -293,7 +293,7 @@ gcdb_write_wpt(const waypoint *wpt)
         */
        reclen = gcdb_add_to_rec(rec, NULL, 0, NULL);
 
-       opdb_rec = new_Record(0, 2, ct++, reclen, (const ubyte *)rec);
+       opdb_rec = new_Record(0, 2, ct++, (uword) reclen, (const ubyte *)rec);
 
        if (opdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create record\n");
index c73ca8dbb1da76fe19846dd491a510b8506cd769..69e22e8ca12e7d25e92d44891568f4826e431b4d 100644 (file)
@@ -484,7 +484,7 @@ copilot_writewpt(const waypoint *wpt)
            fatal(MYNAME ": libpdb couldn't get record memory\n");
     }
 
-    opdb_rec = new_Record (0, 0, ct++, vlen+1, vdata);        
+    opdb_rec = new_Record (0, 0, ct++, (uword) (vlen+1), vdata);              
 
     if (opdb_rec == NULL)
        fatal(MYNAME ": libpdb couldn't create record\n");
index 8a99914b037d9a354a51949d65ab44800e672dc3..3fe98162d5d1d77349e494f9a48057e576ba5194 100644 (file)
@@ -36,7 +36,7 @@ arglist_t glogbook_args[] = {
 
 /* Tracks */
 static xg_callback     gl_trk_s;
-static xg_callback     gl_trk_ident;
+// static xg_callback  gl_trk_ident;
 static xg_callback     gl_trk_pnt_s, gl_trk_pnt_e;
 static xg_callback     gl_trk_utc;
 static xg_callback     gl_trk_lat;
@@ -126,11 +126,12 @@ void      gl_trk_s(const char *args, const char **unused)
        trk_head = route_head_alloc();
        track_add_head(trk_head);
 }
-
+#if 0
 void   gl_trk_ident(const char *args, const char **unused)
 {
        trk_head->rte_name = xstrdup(args);
 }
+#endif
 
 void   gl_trk_pnt_s(const char *args, const char **unused)
 {
index bf1dda40c3cf09670e4daa0134ed770ba38e99be..24cd5e606381d8f59746eef0ebd027c875b8f6e9 100644 (file)
@@ -405,7 +405,7 @@ my_write_wpt(const waypoint *wpt)
        le_write32(&rec->wpt.d103.lat, lat);
        le_write32(&rec->wpt.d103.lon, lon);
 
-       opdb_rec = new_Record(0, 0, ct++, vdata - (char *) rec, (const ubyte *) rec);
+       opdb_rec = new_Record(0, 0, ct++, (uword) (vdata - (char *) rec), (const ubyte *) rec);
 
        if (opdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create record\n");
index 2c74f9966461b78c4a38656cf6b4b423ac4e41f7..4bc70779877b097dc394c6358fed91d7b145f444 100644 (file)
@@ -207,7 +207,7 @@ gpspilot_writewpt(const waypoint *wpt)
         }
         vdata += strlen( vdata ) + 1;
 
-        opdb_rec = new_Record (0, 2, ct++, vdata-(char *)rec, (const ubyte *)rec);            
+        opdb_rec = new_Record (0, 2, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);          
 
        if (opdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create record\n");
index fd6a93a1d9386a2f947a6f4888361a0c73f6c884..78f6590d73fc8e17126e64d717f9fc3d720c1ce7 100644 (file)
@@ -495,7 +495,7 @@ gs_container_mapping{
 };
 
 geocache_type
-gs_mktype(char *t)
+gs_mktype(const char *t)
 {
        int i;
        int sz = sizeof(gs_type_map) / sizeof(gs_type_map[0]);
@@ -523,7 +523,7 @@ gs_get_cachetype(geocache_type t)
 }
 
 geocache_container
-gs_mkcont(char *t)
+gs_mkcont(const char *t)
 {
        int i;
        int sz = sizeof(gs_container_map) / sizeof(gs_container_map[0]);
@@ -1117,7 +1117,6 @@ write_gpx_url(const waypoint *waypointp)
 static void
 gpx_waypt_pr(const waypoint *waypointp)
 {
-       char *tmp_ent;
        const char *oname;
        char *odesc;
 
index aad90cfcef90eff3b3183cafc1cbdd206b736978..1e224fc0388860249bfbc352b349f73878e0a091 100644 (file)
@@ -70,8 +70,8 @@ html_disp(const waypoint *wpt)
        double utme, utmn;
        char utmzc;
        
-       lonint = abs(wpt->longitude);
-       latint = abs(wpt->latitude);
+       lonint = abs((int) wpt->longitude);
+       latint = abs((int) wpt->latitude);
        GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, 
                &utme, &utmn, &utmz, &utmzc);
 
index ceaeae8cde8da5c2e3204876c065828a4966a86d..37f98cee800afd9e2caa9d28c194cf0e02191ab3 100644 (file)
@@ -842,20 +842,20 @@ static void wr_track(void)
        QUEUE_FOR_EACH(&gnss_track->waypoint_list, elem, tmp) {
            wpt = (waypoint *) elem;
            pres_alt = interpolate_alt(pres_track, wpt->creation_time + time_adj);
-           wr_fix_record(wpt, pres_alt, wpt->altitude);
+           wr_fix_record(wpt, (int) pres_alt, (int) wpt->altitude);
        }
     } else {
        if (pres_track) {
            // Only the pressure altitude track was found so generate fix
            // records from it alone.
            QUEUE_FOR_EACH(&pres_track->waypoint_list, elem, tmp) {
-               wr_fix_record((waypoint *) elem, ((waypoint *) elem)->altitude, unknown_alt);
+               wr_fix_record((waypoint *) elem, (int) ((waypoint *) elem)->altitude, (int) unknown_alt);
            }
        } else if (gnss_track) {
            // Only the GNSS altitude track was found so generate fix
            // records from it alone.
            QUEUE_FOR_EACH(&gnss_track->waypoint_list, elem, tmp) {
-               wr_fix_record((waypoint *) elem, unknown_alt, ((waypoint *) elem)->altitude);
+               wr_fix_record((waypoint *) elem, (int) unknown_alt, (int) ((waypoint *) elem)->altitude);
            }
        } else {
            // No tracks found so nothing to do
index 686a813981b46ddc7944e4fb008e80d9e106101e..69dba75aacdf68d14c4e98fa756961f0e0c25bb2 100644 (file)
@@ -182,7 +182,6 @@ extern double gps_save_version;
 extern char   gps_save_string[GPS_ARB_LEN];
 extern int gps_is_usb;
 
-
 extern struct COMMANDDATA COMMAND_ID[2];
 extern struct LINKDATA LINK_ID[3];
 extern struct GPS_MODEL_PROTOCOL GPS_MP[];
@@ -193,7 +192,6 @@ extern char *gps_aviation_sym[];
 extern char *gps_16_sym[];
 
 
-
 #endif
 
 #ifdef __cplusplus
index e58ca1a8ab7f22bd9ded4e6a146a6b54f3395660..4e237a08b431b7c79236bb6534f32ddb5762f374 100644 (file)
@@ -26,6 +26,7 @@
 #include <string.h>
 #include <time.h>
 #include <stdlib.h>
+#include <ctype.h>
 
 #define XMIN(a,b) (a < b? a : b)
 
@@ -616,7 +617,7 @@ static void GPS_A001(GPS_PPacket packet)
 **
 ** @return [int32] number of waypoint entries
 ************************************************************************/
-int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)())
+int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)(int, GPS_PWay *))
 {
     static UC data[2];
     int32 fd;
@@ -770,7 +771,7 @@ int32 GPS_A100_Get(const char *port, GPS_PWay **way, int (*cb)())
 **
 ** @return [int32] success
 ************************************************************************/
-int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)())
+int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)(GPS_PWay *))
 {
     UC data[GPS_ARB_LEN];
     int32 fd;
@@ -785,7 +786,7 @@ int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)())
     if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
        return MEMORY_ERROR;
 
-    GPS_Util_Put_Short(data,n);
+    GPS_Util_Put_Short(data, (short) n);
     GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
                    data,2);
     if(!GPS_Write_Packet(fd,tra))
@@ -800,7 +801,7 @@ int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)())
     for(i=0;i<n;++i)
     {
         if (cb) {
-               if (cb(way[i]))
+               if (cb((GPS_PWay *) way[i]))  /* BUGBUG Wrong level of indirection */
                        break;
        }
 
@@ -860,7 +861,7 @@ int32 GPS_A100_Send(const char *port, GPS_PWay *way, int32 n, int (*cb)())
        }
 
        GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Wpt_Data,
-                       data,len);
+                  data, (US) len);
 
        if(!GPS_Write_Packet(fd,tra))
            return gps_errno;
@@ -1242,9 +1243,9 @@ static void GPS_D108_Get(GPS_PWay *way, UC *s)
     
     (*way)->alt = GPS_Util_Get_Float(p);
     p+=sizeof(float);
-    (*way)->dpth = (int32)GPS_Util_Get_Float(p);
+    (*way)->dpth = GPS_Util_Get_Float(p);
     p+=sizeof(float);
-    (*way)->dst = (int32)GPS_Util_Get_Float(p);
+    (*way)->dst = GPS_Util_Get_Float(p);
     p+=sizeof(float);
 
     for(i=0;i<2;++i) (*way)->state[i] = *p++;
@@ -1309,9 +1310,9 @@ static void GPS_D109_Get(GPS_PWay *way, UC *s, int protoid)
     
     (*way)->alt = GPS_Util_Get_Float(p);
     p+=sizeof(float);
-    (*way)->dpth = (int32)GPS_Util_Get_Float(p);
+    (*way)->dpth = GPS_Util_Get_Float(p);
     p+=sizeof(float);
-    (*way)->dst = (int32)GPS_Util_Get_Float(p);
+    (*way)->dst = GPS_Util_Get_Float(p);
     p+=sizeof(float);
 
     for(i=0;i<2;++i) (*way)->state[i] = *p++;
@@ -1604,7 +1605,6 @@ static void GPS_D155_Get(GPS_PWay *way, UC *s)
 static void GPS_D100_Send(UC *data, GPS_PWay way, int32 *len)
 {
     UC *p;
-    int32 i;
     
     p = data;
 
@@ -1636,7 +1636,6 @@ static void GPS_D100_Send(UC *data, GPS_PWay way, int32 *len)
 static void GPS_D101_Send(UC *data, GPS_PWay way, int32 *len)
 {
     UC *p;
-    int32 i;
     
     p = data;
 
@@ -1674,7 +1673,6 @@ static void GPS_D101_Send(UC *data, GPS_PWay way, int32 *len)
 static void GPS_D102_Send(UC *data, GPS_PWay way, int32 *len)
 {
     UC *p;
-    int32 i;
     
     p = data;
 
@@ -1690,7 +1688,7 @@ static void GPS_D102_Send(UC *data, GPS_PWay way, int32 *len)
     GPS_Util_Put_Float(p,way->dst);
     p+= sizeof(float);
 
-    GPS_Util_Put_Short(p,way->smbl);
+    GPS_Util_Put_Short(p,(US) way->smbl);
     
     *len = 64;
     
@@ -1711,7 +1709,6 @@ static void GPS_D102_Send(UC *data, GPS_PWay way, int32 *len)
 static void GPS_D103_Send(UC *data, GPS_PWay way, int32 *len)
 {
     UC *p;
-    int32 i;
     
     p = data;
 
@@ -1725,8 +1722,8 @@ static void GPS_D103_Send(UC *data, GPS_PWay way, int32 *len)
     p+=sizeof(int32);
     copy_char_array(&p, way->cmnt, 40, UpperYes);
 
-    *p++ = way->smbl;
-    *p   = way->dspl;
+    *p++ = (UC) way->smbl;
+    *p   = (UC) way->dspl;
     
     *len = 60;
     
@@ -1747,7 +1744,6 @@ static void GPS_D103_Send(UC *data, GPS_PWay way, int32 *len)
 static void GPS_D104_Send(UC *data, GPS_PWay way, int32 *len)
 {
     UC *p;
-    int32 i;
     
     p = data;
 
@@ -1767,7 +1763,7 @@ static void GPS_D104_Send(UC *data, GPS_PWay way, int32 *len)
     GPS_Util_Put_Float(p,way->dst);
     p+= sizeof(float);
 
-    GPS_Util_Put_Short(p,way->smbl);
+    GPS_Util_Put_Short(p, (int16) way->smbl);
     p+=sizeof(int16);
 
     *p = 3; /* display symbol with waypoint name */
@@ -1800,7 +1796,7 @@ static void GPS_D105_Send(UC *data, GPS_PWay way, int32 *len)
     GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
     p+=sizeof(int32);
 
-    GPS_Util_Put_Short(p,way->smbl);
+    GPS_Util_Put_Short(p, (int16) way->smbl);
     p+=sizeof(int16);
 
     q = (UC *) way->wpt_ident;
@@ -1838,7 +1834,7 @@ static void GPS_D106_Send(UC *data, GPS_PWay way, int32 *len)
     GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
     p+=sizeof(int32);
 
-    GPS_Util_Put_Short(p,way->smbl);
+    GPS_Util_Put_Short(p, (int16) way->smbl);
     p+=sizeof(int16);
 
     q = (UC *) way->wpt_ident;
@@ -1865,7 +1861,6 @@ static void GPS_D106_Send(UC *data, GPS_PWay way, int32 *len)
 static void GPS_D107_Send(UC *data, GPS_PWay way, int32 *len)
 {
     UC *p;
-    int32 i;
     
     p = data;
 
@@ -1916,7 +1911,7 @@ static void GPS_D108_Send(UC *data, GPS_PWay way, int32 *len)
     *p++ = way->colour;
     *p++ = way->dspl;
     *p++ = 0x60;
-    GPS_Util_Put_Short(p,way->smbl);
+    GPS_Util_Put_Short(p,(US) way->smbl);
     p+=sizeof(int16);
     for(i=0;i<18;++i) *p++ = way->subclass[i];
     GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lat));
@@ -1990,7 +1985,7 @@ static void GPS_D109_Send(UC *data, GPS_PWay way, int32 *len, int protoid)
     } else {
        GPS_Warning("Unknown protoid in GPS_D109_Send.");
     }
-    GPS_Util_Put_Short(p,way->smbl);
+    GPS_Util_Put_Short(p,(US) way->smbl);
     p+=sizeof(int16);
     for(i=0;i<18;++i) *p++ = way->subclass[i];
     GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lat));
@@ -2008,7 +2003,7 @@ static void GPS_D109_Send(UC *data, GPS_PWay way, int32 *len, int protoid)
     for(i=0;i<2;++i) *p++ = way->cc[i];
     for(i=0;i<4;++i) *p++ = 0xff; /* D109 silliness for ETE */
     if (protoid == 110) {
-       float temp = 1.0e25;
+       float temp = 1.0e25f;
 
        GPS_Util_Put_Float(p, temp);
        p += 4;
@@ -2074,7 +2069,7 @@ static void GPS_D150_Send(UC *data, GPS_PWay way, int32 *len)
     GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
     p+=sizeof(int32);
 
-    GPS_Util_Put_Short(p,way->alt);
+    GPS_Util_Put_Short(p,(US) way->alt);
     p+=sizeof(int16);
 
     copy_char_array(&p, way->city, 24, UpperYes);
@@ -2121,7 +2116,7 @@ static void GPS_D151_Send(UC *data, GPS_PWay way, int32 *len)
     copy_char_array(&p, way->city, 24, UpperYes);
     copy_char_array(&p, way->state, 2, UpperYes);
 
-    GPS_Util_Put_Short(p,way->alt);
+    GPS_Util_Put_Short(p,(US) way->alt);
     p+=sizeof(int16);
 
     for(i=0;i<2;++i) *p++ = way->cc[i];
@@ -2170,7 +2165,7 @@ static void GPS_D152_Send(UC *data, GPS_PWay way, int32 *len)
     copy_char_array(&p, way->city, 24, UpperYes);
     copy_char_array(&p, way->state, 2, UpperYes);
 
-    GPS_Util_Put_Short(p,way->alt);
+    GPS_Util_Put_Short(p,(US) way->alt);
     p+=sizeof(int16);
 
     for(i=0;i<2;++i) *p++ = way->cc[i];
@@ -2219,7 +2214,7 @@ static void GPS_D154_Send(UC *data, GPS_PWay way, int32 *len)
     copy_char_array(&p, way->city, 24, UpperYes);
     copy_char_array(&p, way->state, 2, UpperYes);
 
-    GPS_Util_Put_Short(p,way->alt);
+    GPS_Util_Put_Short(p,(US) way->alt);
     p+=sizeof(int16);
 
     for(i=0;i<2;++i) *p++ = way->cc[i];
@@ -2270,7 +2265,7 @@ static void GPS_D155_Send(UC *data, GPS_PWay way, int32 *len)
     copy_char_array(&p, way->city, 24, UpperYes);
     copy_char_array(&p, way->state, 2, UpperYes);
 
-    GPS_Util_Put_Short(p,way->alt);
+    GPS_Util_Put_Short(p,(US) way->alt);
     p+=sizeof(int16);
 
     for(i=0;i<2;++i) *p++ = way->cc[i];
@@ -2685,7 +2680,7 @@ int32 GPS_A200_Send(const char *port, GPS_PWay *way, int32 n)
     if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
        return MEMORY_ERROR;
 
-    GPS_Util_Put_Short(data,n);
+    GPS_Util_Put_Short(data,(US) n);
     GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
                    data,2);
     if(!GPS_Write_Packet(fd,tra))
@@ -2774,7 +2769,7 @@ int32 GPS_A200_Send(const char *port, GPS_PWay *way, int32 n)
        }
        
 
-       GPS_Make_Packet(&tra, method, data,len);
+       GPS_Make_Packet(&tra, method, data,(US) len);
 
        if(!GPS_Write_Packet(fd,tra))
            return gps_errno;
@@ -2834,7 +2829,7 @@ int32 GPS_A201_Send(const char *port, GPS_PWay *way, int32 n)
     if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
        return MEMORY_ERROR;
 
-    GPS_Util_Put_Short(data,n);
+    GPS_Util_Put_Short(data,(US) n);
     GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
                    data,2);
     if(!GPS_Write_Packet(fd,tra))
@@ -2943,7 +2938,7 @@ int32 GPS_A201_Send(const char *port, GPS_PWay *way, int32 n)
        }
        
 
-       GPS_Make_Packet(&tra, method, data,len);
+       GPS_Make_Packet(&tra, method, data,(US) len);
 
        if(!GPS_Write_Packet(fd,tra))
            return gps_errno;
@@ -3175,7 +3170,7 @@ static void GPS_D210_Send(UC *data, GPS_PWay way, int32 *len)
     
     p = data;
 
-    GPS_Util_Put_Short(p,way->rte_link_class);
+    GPS_Util_Put_Short(p,(US) way->rte_link_class);
     p+=sizeof(int16);
     for(i=0;i<18;++i) *p++ = way->rte_link_subclass[i];
 
@@ -3458,7 +3453,7 @@ int32 GPS_A300_Send(const char *port, GPS_PTrack *trk, int32 n)
     if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
        return MEMORY_ERROR;
 
-    GPS_Util_Put_Short(data,n);
+    GPS_Util_Put_Short(data,(US) n);
     GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
                    data,2);
     if(!GPS_Write_Packet(fd,tra))
@@ -3483,7 +3478,7 @@ int32 GPS_A300_Send(const char *port, GPS_PTrack *trk, int32 n)
        }
 
        GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Trk_Data,
-                       data,len);
+                       data,(US) len);
 
        if(!GPS_Write_Packet(fd,tra))
            return gps_errno;
@@ -3553,7 +3548,7 @@ int32 GPS_A301_Send(const char *port, GPS_PTrack *trk, int32 n)
     if(!(tra = GPS_Packet_New()) || !(rec = GPS_Packet_New()))
        return MEMORY_ERROR;
 
-    GPS_Util_Put_Short(data,n);
+    GPS_Util_Put_Short(data,(US) n);
     GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
                    data,2);
     if(!GPS_Write_Packet(fd,tra))
@@ -3604,7 +3599,7 @@ int32 GPS_A301_Send(const char *port, GPS_PTrack *trk, int32 n)
        }
        
 
-       GPS_Make_Packet(&tra, method, data,len);
+       GPS_Make_Packet(&tra, method, data,(US) len);
 
        if(!GPS_Write_Packet(fd,tra))
            return gps_errno;
@@ -3834,7 +3829,6 @@ void GPS_D310_Get(GPS_PTrack *trk, UC *s)
 void GPS_D311_Get(GPS_PTrack *trk, UC *s)
 {
     UC *p;
-    UC *q;
     short identifier;
     
     p=s;
@@ -4184,7 +4178,7 @@ int32 GPS_A400_Send(const char *port, GPS_PWay *way, int32 n)
        return MEMORY_ERROR;
 
 
-    GPS_Util_Put_Short(data,n);
+    GPS_Util_Put_Short(data,(US) n);
     GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
                    data,2);
     if(!GPS_Write_Packet(fd,tra))
@@ -4248,7 +4242,7 @@ int32 GPS_A400_Send(const char *port, GPS_PWay *way, int32 n)
        }
 
        GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Prx_Wpt_Data,
-                       data,len);
+                       data,(US) len);
 
        if(!GPS_Write_Packet(fd,tra))
            return gps_errno;
@@ -4489,7 +4483,7 @@ static void GPS_D450_Send(UC *data, GPS_PWay way, int32 *len)
 
     p = data;
 
-    GPS_Util_Put_Short(p,way->idx);
+    GPS_Util_Put_Short(p,(US) way->idx);
     p+=sizeof(int16);
 
     for(i=0;i<6;++i) *p++ = way->ident[i];
@@ -4501,7 +4495,7 @@ static void GPS_D450_Send(UC *data, GPS_PWay way, int32 *len)
     GPS_Util_Put_Int(p,(int32)GPS_Math_Deg_To_Semi(way->lon));
     p+=sizeof(int32);
 
-    GPS_Util_Put_Short(p,way->alt);
+    GPS_Util_Put_Short(p,(US) way->alt);
     p+=sizeof(int16);
 
     for(i=0;i<24;++i) *p++ = way->city[i];
@@ -4641,7 +4635,7 @@ int32 GPS_A500_Send(const char *port, GPS_PAlmanac *alm, int32 n)
        return MEMORY_ERROR;
 
 
-    GPS_Util_Put_Short(data,n);
+    GPS_Util_Put_Short(data,(US) n);
     GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Records,
                    data,2);
     if(!GPS_Write_Packet(fd,tra))
@@ -4693,7 +4687,7 @@ int32 GPS_A500_Send(const char *port, GPS_PAlmanac *alm, int32 n)
        }
 
        GPS_Make_Packet(&tra, LINK_ID[gps_link_type].Pid_Almanac_Data,
-                       data,len);
+                       data,(US) len);
 
        if(!GPS_Write_Packet(fd,tra))
            return gps_errno;
@@ -5385,9 +5379,9 @@ void GPS_D600_Send(GPS_PPacket *packet, time_t Time)
     *p++ = ts->tm_mon+1;
     *p++ = ts->tm_mday;
 
-    GPS_Util_Put_Short(p,ts->tm_year+1900);
+    GPS_Util_Put_Short(p,(US) (ts->tm_year+1900));
     p+=2;
-    GPS_Util_Put_Short(p,ts->tm_hour);
+    GPS_Util_Put_Short(p,(US) ts->tm_hour);
     p+=2;
 
     *p++ = ts->tm_min;
index 9cfca03312f1d1b025c88d984bf6fa6f2ba99002..b3d6b3e05660818eba588b064a0d9328c8970703 100644 (file)
@@ -84,7 +84,7 @@ int32 GPS_Command_Off(const char *port)
 ** @return [int32] number of waypoint entries
 ************************************************************************/
 
-int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)())
+int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)(int, struct GPS_SWay **))
 {
     int32 ret=0;
 
@@ -114,7 +114,7 @@ int32 GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way, int (*cb)())
 ** @return [int32] success
 ************************************************************************/
 
-int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)())
+int32 GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)(struct GPS_SWay **))
 {
     int32 ret=0;
 
index 0d84157367b2605a13afbe440e5aa42db56a00d4..e8bbe1d2a8296fa0c216a3267088cc5e98e4696c 100644 (file)
@@ -28,8 +28,8 @@ int32  GPS_Command_Send_Almanac(const char *port, GPS_PAlmanac *alm, int32 n);
 int32  GPS_Command_Get_Track(const char *port, GPS_PTrack **trk);
 int32  GPS_Command_Send_Track(const char *port, GPS_PTrack *trk, int32 n);
 
-int32  GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way,int (*cb)());
-int32  GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)());
+int32  GPS_Command_Get_Waypoint(const char *port, GPS_PWay **way,int (*cb)(int, struct GPS_SWay **));
+int32  GPS_Command_Send_Waypoint(const char *port, GPS_PWay *way, int32 n, int (*cb)(struct GPS_SWay **));
 
 int32  GPS_Command_Get_Proximity(const char *port, GPS_PWay **way);
 int32  GPS_Command_Send_Proximity(const char *port, GPS_PWay *way, int32 n);
index 4fe5caa1488c06a29cc6d64d8fb4731d9aa28ed5..6a9e75bc10a26e1f8b94a677954158a792576b7b 100644 (file)
@@ -247,7 +247,7 @@ int32 gps_link_type;
 
 struct GPS_MODEL_PROTOCOL
 {
-    int32 id;
+    US    id;
     int32 link;
     int32 command;
     int32 wayptt;
index d37fe6f3e4cbe5745c3f10f3a0e1d667a9e46f81..2d2f2d153fb2a77b0cb4b9862bfe03a84cc3f19f 100644 (file)
@@ -22,6 +22,7 @@
 ** Boston, MA  02111-1307, USA.
 ********************************************************************/
 #include "gps.h"
+#include "gpsusbint.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <time.h>
index 138cc586604a27261f8b658bf32224574891332c..5abd56cfa1ad2b40a3b0a86234e142720692d9d9 100644 (file)
@@ -12,6 +12,7 @@ extern "C"
 
 time_t GPS_Time_Now(void);
 int32  GPS_Packet_Read(int32 fd, GPS_PPacket *packet);
+int32  GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet);
 int32  GPS_Get_Ack(int32 fd, GPS_PPacket *tra, GPS_PPacket *rec);
 int32  ajb(int32 fd);
 
index c4b299d7a9ffe448f8ac19d0130bd205663e6c29..b32ba2a27f8e12eafb277aef399a838cbe7797bc 100644 (file)
 ** Boston, MA  02111-1307, USA.
 ********************************************************************/
 #include "gps.h"
+#include "gpsusbint.h"
+
 #include <stdio.h>
 #include <errno.h>
+#include <ctype.h>
 
 
 /* @func GPS_Make_Packet ***********************************************
@@ -58,7 +61,7 @@ void GPS_Make_Packet(GPS_PPacket *packet, UC type, UC *data, int16 n)
     (*packet)->dle   = DLE;
     (*packet)->edle  = DLE;
     (*packet)->etx   = ETX;
-    (*packet)->n     = n;
+    (*packet)->n     = (UC) n;
     (*packet)->type  = type;
     (*packet)->bytes = 0;
 
index 68b97a9dac1c09f216d77db2db7ec20ef8fd1a5c..9e8eb41adea18d749e5d2a79839b0f82c15e892c 100644 (file)
@@ -23,6 +23,7 @@
 ** Boston, MA  02111-1307, USA.
 ********************************************************************/
 #include "gps.h"
+#include "garminusb.h"
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
@@ -208,7 +209,7 @@ int32 GPS_Serial_Write(int32 ignored, const void *obuf, int size)
                return 0;
        }
        WriteFile (comport, obuf, size, &len, NULL);
-       if (len != size) {
+       if (len != (DWORD) size) {
                fatal ("Write error.   Wrote %d of %d bytes.", len, size);
        }
        return len;
index 1849cd01c812eee239512bb04553282d58e0bf0e..7d3958d4846424e4463fabeae5afcea90bcad636 100644 (file)
@@ -24,6 +24,7 @@ int32  GPS_Serial_Flush(int32 fd);
 int32  GPS_Serial_On_NMEA(const char *port, int32 *fd);
 int32  GPS_Serial_Read(int32 ignored, void *ibuf, int size);
 int32  GPS_Serial_Write(int32 ignored, const void *obuf, int size);
+void   GPS_Serial_Error(char *hdr);
 
 
 #endif
index edcabf6ab14e0b5adf1dc665592813089709ef67..cff319a232173645a0f689f8c5776845fcc693c1 100644 (file)
@@ -21,6 +21,7 @@
 #include <ctype.h>
 #include "gps.h"
 #include "garminusb.h"
+#include "gpsusbint.h"
 
 int32 GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet)
 {
@@ -54,7 +55,7 @@ int32 GPS_Packet_Read_usb(int32 fd, GPS_PPacket *packet)
         */
        (*packet)->type = le_read16(&pkt.gusb_pkt.pkt_id);
        payload_size = le_read32(&pkt.gusb_pkt.datasz);
-       (*packet)->n = payload_size;
+       (*packet)->n = (UC) payload_size;
        memcpy((*packet)->data, &pkt.gusb_pkt.databuf, payload_size);
        return payload_size;
 }
index a6af171f33c9e70837779f8201e323fc19c2c6dc..8e0877a451c0cb452ea618605ba29515c28368cb 100644 (file)
@@ -23,6 +23,7 @@
 #include <stdio.h>
 #include <errno.h>
 #include "garminusb.h"
+#include "gpsusbint.h"
 
 void 
 GPS_Make_Packet_usb(GPS_PPacket *packet, UC type, UC *data, int16 n)
@@ -36,7 +37,7 @@ GPS_Make_Packet_usb(GPS_PPacket *packet, UC type, UC *data, int16 n)
 
        (*packet)->type = type;
        memcpy((*packet)->data, data, n);
-       (*packet)->n = n;
+       (*packet)->n = (UC) n;
        
        return;
 }
@@ -44,8 +45,6 @@ GPS_Make_Packet_usb(GPS_PPacket *packet, UC type, UC *data, int16 n)
 int32
 GPS_Write_Packet_usb(int32 fd, GPS_PPacket packet)
 {
-       size_t ret, sz;
-
        garmin_usb_packet gp = {0};
 
 
index c841351c418f0eaa01df6d66c1d0a44dd4af8976..44f15ddda1e85b6fcf4509dd9754f57fd9e3b7f8 100644 (file)
@@ -83,7 +83,7 @@ gusb_open(const char *pname)
 // }
        }
 
-       hdevinfo = SetupDiGetClassDevs( &GARMIN_GUID, NULL, NULL, 
+       hdevinfo = SetupDiGetClassDevs( (GUID *) &GARMIN_GUID, NULL, NULL, 
                        DIGCF_PRESENT|DIGCF_INTERFACEDEVICE);
 
        if (hdevinfo == INVALID_HANDLE_VALUE) {
@@ -93,7 +93,7 @@ gusb_open(const char *pname)
 
        /* Get the device associated with this index. */
        devinterface.cbSize = sizeof(SP_INTERFACE_DEVICE_DATA);
-       if (!SetupDiEnumDeviceInterfaces(hdevinfo, NULL, &GARMIN_GUID, 
+       if (!SetupDiEnumDeviceInterfaces(hdevinfo, NULL, (GUID *) &GARMIN_GUID, 
                        0, &devinterface)) {
                GPS_Serial_Error("SetupDiEnumDeviceInterfaces");
                warning("Is the unit powered up and connected?");
@@ -173,13 +173,14 @@ gusb_close(const char *portname)
                usb_handle = INVALID_HANDLE_VALUE;
 #endif
        }
+  return 0;
 }
 
 int
 gusb_cmd_get(garmin_usb_packet *ibuf, size_t sz)
 {
        DWORD rxed = GARMIN_USB_INTERRUPT_DATA_SIZE;
-       unsigned char *buf = &ibuf->dbuf;
+       unsigned char *buf = (unsigned char *) &ibuf->dbuf;
        int i;
        int tsz=0;
        unsigned char *obuf = buf;
@@ -194,7 +195,7 @@ gusb_cmd_get(garmin_usb_packet *ibuf, size_t sz)
                fatal("ioctl");
        }
                buf += rxed;
-               sz =- rxed;
+               sz  -= rxed;
                tsz += rxed;
                if (rxed < GARMIN_USB_INTERRUPT_DATA_SIZE) {
                        break;
@@ -221,7 +222,7 @@ gusb_cmd_send(const garmin_usb_packet *opkt, size_t sz)
 {
        DWORD rsz;
        size_t i;
-       unsigned char *obuf = &opkt->dbuf;
+       unsigned char *obuf = (unsigned char *) &opkt->dbuf;
        const char *m1, *m2;
 
        /* The spec warns us about making writes an exact multiple
@@ -255,7 +256,7 @@ gusb_cmd_send(const garmin_usb_packet *opkt, size_t sz)
 static char *
 id_unit(void)
 {
-static const char  oid[12] = {20, 0, 0, 0, 0xfe, 0, 0, 0, 0, 0, 0, 0};
+static const unsigned char  oid[12] = {20, 0, 0, 0, 0xfe, 0, 0, 0, 0, 0, 0, 0};
        /* 
         * Identify the unit before getting into all the protocol gunk.
         * We get two packets back, but we discard the protocol array 
index 1a216ecceb3743152e62b678a270102f4ea25364..0877936cee3cdd43a2ca153b070558067f014a0d 100644 (file)
@@ -148,7 +148,6 @@ kml_wr_deinit(void)
 static void
 kml_waypt_pr(const waypoint *waypointp)
 {
-       char *odesc;
        fputs("    <Placemark>\n", ofd);
 //     write_optional_xml_entity(ofd, "\t", "name", waypointp->shortname);
        write_optional_xml_entity(ofd, "\t", "name", waypointp->description);
index c3342595314be3568a222ed1752f6a7b94a48087..ef9020bfa1ed9dcccc3275cd2315de1b5889a062 100644 (file)
@@ -179,7 +179,7 @@ my_writewpt(const waypoint *wpt)
        
        be_write32(&rec->longitude, si_round(wpt->longitude * 100000.0));
        be_write32(&rec->latitude, si_round(wpt->latitude * 100000.0));
-       be_write32(&rec->elevation, wpt->altitude);
+       be_write32(&rec->elevation, (unsigned int) (wpt->altitude));
 
        rec->plot = 0;
        rec->unknown3 = 'a';
@@ -205,7 +205,7 @@ my_writewpt(const waypoint *wpt)
        vdata[1] = '\0';
        vdata += 2;
        
-       opdb_rec = new_Record (0, 0, ct++, vdata-(char *)rec, (const ubyte *)rec);
+       opdb_rec = new_Record (0, 0, ct++, (uword) (vdata-(char *)rec), (const ubyte *)rec);
 
        if (opdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create record\n");
index b1bc1ef6a18e6dc09c3508a129a99a94d0d6b643..4666d2c5b6e7be35374812e416951b832e6d2942 100644 (file)
@@ -617,7 +617,7 @@ termwrite(char *obuf, int size)
                return;
        }
        WriteFile (comport, obuf, size, &len, NULL);
-       if (len != size) {
+       if ((int) len != size) {
                fatal(MYNAME ":.  Wrote %d of %d bytes.\n", len, size);
        }
 }
index d89b0baab53e64af375052132b8bf89ac5dbe71b..6d632831d9701610f5699fb0cc035433bfe89dd2 100644 (file)
@@ -149,7 +149,7 @@ decode(char *buf)
 //     for(pdb_rec = pdb->rec_index.rec; pdb_rec; pdb_rec=pdb_rec->next) {
        for(pdb_rec=pdb_rec->next; pdb_rec; pdb_rec=pdb_rec->next) {
                waypoint *wpt_tmp;
-               char *vdata;
+               char *vdata = 0;
                char *edata;
                struct tm tm = {0};
 
@@ -266,8 +266,6 @@ my_writewpt(const waypoint *wpt)
 static void
 data_write(void)
 {
-       queue *elem, *tmp;
-
        static char *appinfo = 
                "\0\x01"
                "User\0\0\0\0\0\0\0\0\0\0\0\0"
index 1bf106af7efc409560e8996f9055ead92c82263e..b5c2879a9ad358a44c6c57c33eeb3840c247c3a4 100644 (file)
@@ -544,7 +544,7 @@ void mapsend_track_disp(const waypoint * wpt)
        my_fwrite8(&dbl, mapsend_file_out);
 
        /* altitude */
-       i = wpt->altitude;
+       i = (int) wpt->altitude;
        my_fwrite4(&i, mapsend_file_out);
        
        /* time */
index 83871c700cf5700bc53c7d72f3195ed40d671f31..948d760849240d3fcf3a2f04d7e9f4f6956783bb 100644 (file)
@@ -413,7 +413,7 @@ mps_fileHeader_r(FILE *mps_file, int *mps_ver)
 static void
 mps_fileHeader_w(FILE *mps_file, int mps_ver)
 {
-       char hdr[100];
+       unsigned char hdr[100];
        int reclen;
 
        strcpy (hdr, "MsRc");
@@ -469,10 +469,10 @@ mps_fileHeader_w(FILE *mps_file, int mps_ver)
 static void
 mps_mapsegment_r(FILE *mps_file, int mps_ver)
 {
-       char hdr[100];
        int reclen;
 
        /* At the moment we're not doing anything with map segments, but here's the template code as if we were
+       char hdr[100];
        fread(&CDid, 4, 1, mps_file);
        reclen = le_read32(&CDid);
 
@@ -501,10 +501,10 @@ mps_mapsegment_r(FILE *mps_file, int mps_ver)
 static void
 mps_mapsetname_r(FILE *mps_file, int mps_ver)
 {
-       char hdr[100];
        int reclen;
 
        /* At the moment we're not doing anything with mapsetnames, but here's the template code as if we were
+       char hdr[100];
        mps_readstr(mps_file, hdr, sizeof(hdr));
        char mapsetnamename[very large number?];
        strcpy(mapsetnamename,hdr);
@@ -859,7 +859,7 @@ mps_route_wpt_w_unique_wrapper(const waypoint *wpt)
                }
        }
 }
-
+#if 0
 /*
  * wrapper to include the mps_ver_out information
  * This one always writes a waypoint. If it has been written before
@@ -871,7 +871,6 @@ mps_waypoint_w_uniqloc_wrapper(waypoint *wpt)
 {
        waypoint *wptfound = NULL;
        char                    *newName;
-       unsigned int    uniqueNum = 0;
 
        /* Search for this waypoint in the ones already written */
        wptfound = mps_find_wpt_q_by_name(&written_wpt_head, wpt->shortname);
@@ -903,6 +902,7 @@ mps_waypoint_w_uniqloc_wrapper(waypoint *wpt)
                mps_wpt_q_add(&written_wpt_head, wpt);
        }
 }
+#endif
 
 /*
  * read in from file a route record
@@ -920,9 +920,7 @@ mps_route_r(FILE *mps_file, int mps_ver, route_head **rte)
        int     interlinkStepCount;
        int     thisInterlinkStep;
        unsigned int    mpsclass;
-       int     FFsRead;
 
-       time_t  dateTime = 0;
        route_head *rte_head;
        int rte_count;
 
@@ -1179,7 +1177,6 @@ mps_routehdr_w(FILE *mps_file, int mps_ver, const route_head *rte)
 {
        unsigned int reclen;
        unsigned int rte_datapoints;
-       unsigned int colour = 0;                /* unknown colour */
        int                     rname_len;
        char            *rname;
        char            hdr[20];
@@ -1319,7 +1316,6 @@ mps_routehdr_w(FILE *mps_file, int mps_ver, const route_head *rte)
                        fwrite(zbuf, 9, 1, mps_file);
                }
                else {
-                       unsigned char cbuf[8];
                        hdr[0] = 1;
 
                        fwrite(hdr, 1 , 1, mps_file);
@@ -1348,7 +1344,6 @@ mps_routedatapoint_w(FILE *mps_file, int mps_ver, const waypoint *rtewpt)
        unsigned char hdr[10];
        int                     lat;
        int                     lon;
-       time_t          t = rtewpt->creation_time;
        char            zbuf[20];
        char            ffbuf[20];
        char            *src;
index 36474f1d193e6ff084ecc1868b87bd6a4fefb8fc..45f765deebd525b1833aa708060aaabd246f3266 100644 (file)
@@ -42,7 +42,7 @@ RSC=rc.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
-# ADD CPP /nologo /W3 /GX /O2 /I "expat" /I "..\coldsync" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D VERSION=\"1.2.1_beta01072004_msvc\" /YX /FD /c
+# ADD CPP /nologo /W3 /WX /GX /O2 /I "expat" /I "..\coldsync" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D "__WIN32__" /D VERSION=\"1.2.1_beta01072004_msvc\" /YX /FD /c
 # ADD BASE RSC /l 0x409 /d "NDEBUG"
 # ADD RSC /l 0x409 /d "NDEBUG"
 BSC32=bscmake.exe
@@ -66,8 +66,7 @@ LINK32=link.exe
 # PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
-# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /I "expat" /I "..\coldsync" /D "WIN32" /D "__WIN32__" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D VERSION=\"1.2.1_beta01072004_msvc\" /FR /YX /FD /GZ /c
-# SUBTRACT CPP /WX
+# ADD CPP /nologo /W3 /WX /Gm /GX /ZI /Od /I "expat" /I "..\coldsync" /D "WIN32" /D "__WIN32__" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D VERSION=\"1.2.1_beta01072004_msvc\" /FR /YX /FD /GZ /c
 # ADD BASE RSC /l 0x409 /d "_DEBUG"
 # ADD RSC /l 0x409 /d "_DEBUG"
 BSC32=bscmake.exe
index 9ec42e4eac77a581933d1f69fbfd84b385a7c87b..9c21dd333b6d22b9f3a40c0fb56ab24ac601c8e0 100644 (file)
@@ -33,6 +33,7 @@
                                ObjectFile=".\Release/"
                                ProgramDataBaseFileName=".\Release/"
                                WarningLevel="3"
+                               WarnAsError="TRUE"
                                SuppressStartupBanner="TRUE"
                                DebugInformationFormat="3"
                                CompileAs="0"/>
@@ -40,6 +41,7 @@
                                Name="VCCustomBuildTool"/>
                        <Tool
                                Name="VCLinkerTool"
+                               AdditionalDependencies="setupapi.lib"
                                OutputFile=".\Release/GPSBabel.exe"
                                LinkIncremental="1"
                                SuppressStartupBanner="TRUE"
@@ -95,8 +97,9 @@
                                ProgramDataBaseFileName=".\Debug/"
                                BrowseInformation="1"
                                WarningLevel="3"
+                               WarnAsError="TRUE"
                                SuppressStartupBanner="TRUE"
-                               DebugInformationFormat="4"
+                               DebugInformationFormat="3"
                                CompileAs="0"/>
                        <Tool
                                Name="VCCustomBuildTool"/>
index c5bba8ecb790fc7a06834d5b76faa541c122866d..0a6fd3d686a64650b6cf4d42014ec73d3979ff89 100644 (file)
@@ -439,7 +439,7 @@ nmea_trackpt_pr(const waypoint *wpt)
 }
 
 static void
-nmea_write()
+nmea_write(void)
 {
        waypt_disp_all(nmea_wayptpr);
        track_disp_all(NULL, NULL, nmea_trackpt_pr);
index 32344c821e3d3dab33e6a2a30b4aa67ba3757e67..ba4e2d5cc17ce22eb2453e21805e9b6646126421 100644 (file)
@@ -256,7 +256,8 @@ static void write_header( void ) {
                --recs;
        }
        
-       opdb_rec = new_Record (0, 0, 0, sizeof(struct doc_record0)+sizeof(short)*(ct-1), (const ubyte *)rec0);
+       opdb_rec = new_Record (0, 0, 0, 
+               (uword) (sizeof(struct doc_record0)+sizeof(short)*(ct-1)), (const ubyte *)rec0);
 
        if (opdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create summary record\n");
@@ -316,7 +317,7 @@ static void commit_buffer( void ) {
 
        compress( &buf );
        
-        opdb_rec = new_Record (0, 0, ct++, buf.len, (const ubyte *)buf.data);
+        opdb_rec = new_Record (0, 0, ct++, (uword) buf.len, (const ubyte *)buf.data);
 
         if (opdb_rec == NULL) {
                 fatal(MYNAME ": libpdb couldn't create record\n");
@@ -436,8 +437,8 @@ palmdoc_disp(const waypoint *wpt)
         bm = xstrdup(bookmarktext); 
         create_bookmark(bm);
        
-       lonint = abs(wpt->longitude);
-       latint = abs(wpt->latitude);
+       lonint = abs((int) wpt->longitude);
+       latint = abs((int) wpt->latitude);
 
        GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, 
                &utme, &utmn, &utmz, &utmzc);
index dbf54cd57690fdfcfa993da8337e917782e5a151..49a79929b76cf8a726e059a9d0ca4e2093493973 100644 (file)
@@ -230,7 +230,7 @@ position_noop_t(const route_head *h)
 {
 }
 
-void position_process() 
+void position_process(void
 {
        int i = waypt_count();
        
index 3be021c4ca408e6d2d30a490c0d0ee4e601b07fa..89ab8dd9aaa4552f846aaec40e997b7ac4e83984 100755 (executable)
@@ -208,7 +208,6 @@ static void
 psit_getToken(FILE *psit_file, char *buf, size_t sz, psit_tokenSep_type delimType)
 {
        int c;
-char *buf2 = buf;      /* MRCB debug */
 
        *buf = 0;
 
@@ -285,8 +284,6 @@ psit_waypoint_r(FILE *psit_file, waypoint **wpt)
        int             garmin_icon_num;
 
        waypoint        *thisWaypoint;
-       double  psit_altitude = unknown_alt;
-       double  psit_depth = unknown_alt;
 
        if (strlen(psit_current_token) > 0) {
                thisWaypoint = waypt_new();
@@ -331,10 +328,8 @@ static void
 psit_waypoint_w(FILE *psit_file, const waypoint *wpt)
 {
        int     icon;
-       char *src;
-       const char *ident;
-       int display = 1;
-       int colour = 0;                 /*  (unknown colour) black is 1, white is 16 */
+    const char *ident;
+       char *src = 0;  /* BUGBUG Passed to mkshort */
 
        fprintf(psit_file, "%11.6f,%11.6f,", 
                                                wpt->latitude,
@@ -383,13 +378,10 @@ psit_route_r(FILE *psit_file, route_head **rte)
 
        int             garmin_icon_num;
 
-       time_t  dateTime = 0;
        route_head *rte_head;
        unsigned int rte_count;
 
        waypoint        *thisWaypoint;
-       double  psit_altitude = unknown_alt;
-       double  psit_depth = unknown_alt;
 
        psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL);
 
@@ -525,8 +517,6 @@ psit_track_r(FILE *psit_file, route_head **trk)
        unsigned int trk_count;
 
        waypoint        *thisWaypoint;
-       double  psit_altitude = unknown_alt;
-       double  psit_depth = unknown_alt;
 
        psit_getToken(psit_file,psit_current_token,sizeof(psit_current_token), ltrimEOL);
        if (strlen(psit_current_token) == 0) {
@@ -676,10 +666,6 @@ psit_trackdatapoint_w(FILE *psit_file, const waypoint *wpt)
        time_t  t = wpt->creation_time;
        struct tm *tmTime = gmtime(&t);
 
-       double  psit_altitude = wpt->altitude;
-       double  psit_proximity = unknown_alt;
-       double  psit_depth = unknown_alt;
-
        fprintf(psit_file, "%11.6f,%11.6f,", 
                                                wpt->latitude,
                                                wpt->longitude);
index 164e7307c79743d77cd7ee5b30cd3f59912442d5..e71eda8921da3dd3af43ab580959a5a9e378d565 100644 (file)
@@ -173,9 +173,9 @@ quovadis_writewpt(waypoint *wpt)
 
     rec = (struct record *) xcalloc(sizeof(*rec),1);
 
-    be_write32(&rec->longitude, (wpt->longitude +
-                                180.0) * 1000000.0);
-    be_write32(&rec->latitude, (90.0 - wpt->latitude) * 1000000.0);
+    be_write32(&rec->longitude, (unsigned int) ((wpt->longitude +
+                                180.0) * 1000000.0));
+    be_write32(&rec->latitude, (unsigned int) ((90.0 - wpt->latitude) * 1000000.0));
     if ( wpt->shortname ) {
        strncpy(rec->name, wpt->shortname, 32 );
        rec->name[31] = '\0';
@@ -265,8 +265,8 @@ data_write(void)
 
        if (rec_index != 0) {
            struct pdb_record* pdb_rec;
-           pdb_rec = new_Record(0, 0, ct++, rec_index *
-                                sizeof(struct record), current_rec);
+           pdb_rec = new_Record(0, 0, ct++, (uword) (rec_index *
+                                sizeof(struct record)), current_rec);
        
            if (pdb_rec == NULL) {
                fatal(MYNAME ": libpdb couldn't create record\n");
index 4294e817256cb4831f50d6c895ad20cec30e87ad..cd51d232ee627957b98ddbf634a7d97da6ca64b0 100644 (file)
@@ -37,8 +37,6 @@ static int nameidx;
 static void
 my_rd_init(const char *fname)
 {
-       int i;
-
        ihandle = SHPOpen(fname, "rb" );
        if (ihandle == NULL) {
                fatal(MYNAME ":Cannot open shp file %s for reading\n", fname);
index c8c5021fb13bba98196c34326af43146ee8b909b..494947042c850ef68621882b248b01abdf5f0322 100644 (file)
@@ -74,7 +74,6 @@ stackfilt_process(void)
        queue *elem = NULL;
        queue *tmp = NULL;
        queue tmp_queue;
-       waypoint *wpt_tmp;
        unsigned int tmp_count;
        
        if ( opt_push ) {
index 4bd5f556506c70185e04ecf8f3f5707ea5e58655..82698c28cfa829a79961bc14ce6b7fee647453e3 100644 (file)
@@ -71,8 +71,8 @@ text_disp(const waypoint *wpt)
        double utme, utmn;
        char utmzc;
        
-       lonint = abs(wpt->longitude);
-       latint = abs(wpt->latitude);
+       lonint = abs((int) wpt->longitude);
+       latint = abs((int) wpt->latitude);
 
        GPS_Math_WGS84_To_UTM_EN(wpt->latitude, wpt->longitude, 
                &utme, &utmn, &utmz, &utmzc);
index ed3b9ec5f86928d22179ef553e98608ef1ada4d3..5df969a82b4e3d8bcce9eaa87d2904bd545910ae 100644 (file)
@@ -1,3 +1,4 @@
+# cvsps -u
 cvsps $* |  awk '
 /^Date:/ { 
        logt = "";
index 165453a3ef1868fea196eb71fed5916cd71de394..ae4453d0f9ecaca4a9fafe9fa9f83badb318d8f2 100644 (file)
@@ -497,8 +497,6 @@ get_tz_offset(void)
 time_t
 current_time(void)
 {
-       static char *frozen;
-       
        if (getenv("GPSBABEL_FREEZE_TIME")) {
                return 0;
        }
@@ -917,7 +915,6 @@ strip_nastyhtml(const char * in)
 {
        char *returnstr, *sp;
        char *lcstr, *lcp;
-       int i;
        
        sp = returnstr = xstrdup(in);
        lcp = lcstr = xstrdup(in);
index 3f6fc01a2b694ef6e8b0372f64906c4e9c53bfbf..97b6314762eb0264ab3c3cf59c4824c8b04aafd1 100755 (executable)
  */
 
 #include "uuid.h"
-
-static unsigned char
-random()
-{
-       if (getenv("GPSBABEL_FREEZE_TIME")) {
-               static unsigned char blech = 0;
-               return blech++;
-       } else
-               return ;
-}
-
+#include <stdlib.h>
 
 void
 uuid_generate(uuid_t uu)
index 2ffbc79a9931c249e463d10919a3af53f54b2ac9..64fb45cc1f37b4ebe2b1b5705ac55aafc9329193 100644 (file)
@@ -89,14 +89,9 @@ static void
 vcf_disp(const waypoint *wpt)
 {
        int latint, lonint;
-       char tbuf[1024];
-       time_t tm = wpt->creation_time;
-       long utmz;
-       double utme, utmn;
-       char utmzc;
        
-       lonint = abs(wpt->longitude);
-       latint = abs(wpt->latitude);
+       lonint = abs((int) wpt->longitude);
+       latint = abs((int) wpt->latitude);
 
        fprintf(file_out, "BEGIN:VCARD\nVERSION:3.0\n");
        fprintf(file_out, "N:%s;%s;;;\n", wpt->description,wpt->shortname);